﻿using WatiN.Core;
using System.Text.RegularExpressions;
using AttributeConstraint=WatiN.Core.Constraints.AttributeConstraint;

namespace WatiNCF
{
    public static class WatinFind
    {
        /// <summary>
        /// Gets an attribute constraint using a partial id.
        /// </summary>
        /// <param name="partialElementId">The partial element id.</param>
        /// <returns></returns>
        public static AttributeConstraint ByPartialId(string partialElementId)
        {
            return Find.ById(new Regex(".*" + partialElementId + "$"));
        }
    }
}